package com.ruoyi.common.websocket;

import javax.websocket.Session;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArraySet;

public interface IWebSocket {
    // 存储socket对象
    public static ConcurrentHashMap<String, IWebSocket> socketMap = new ConcurrentHashMap<>();
    public static ConcurrentHashMap<String, IWebSocket> vueSocket = new ConcurrentHashMap<>();

    // 接口函数
    // 连接
    public void connect(Session session, String uuid);
    // 断连
    public void disConnect();
    // 推送
    public void push(String msg);
    public void push(String uuid, String msg);
    // 接收
    public void msgArriveDefault(String msg);
    // 错误处理
    public void msgSendError(Session session, Throwable error);

}
